/*  1:   */ package org.jetbrains.generate.tostring.inspection;
/*  2:   */ 
/*  3:   */

import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiClass;
import com.intellij.psi.util.PsiTreeUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.generate.tostring.GenerateToStringActionHandler;
import org.jetbrains.generate.tostring.GenerateToStringActionHandlerImpl;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */ 
/* 12:   */ public class GenerateToStringQuickFix
/* 13:   */   implements LocalQuickFix
/* 14:   */ {
/* 15:32 */   public static final GenerateToStringQuickFix INSTANCE = new GenerateToStringQuickFix();
/* 16:34 */   private final GenerateToStringActionHandler a = new GenerateToStringActionHandlerImpl();
/* 17:   */   
/* 18:   */   public static GenerateToStringQuickFix getInstance()
/* 19:   */   {
/* 20:39 */     return INSTANCE;
/* 21:   */   }
/* 22:   */   
/* 23:   */   @NotNull
/* 24:   */   public String getName()
/* 25:   */   {
/* 26:45 */     String tmp2_0 = "Generate toString()";
/* 27:45 */     if (tmp2_0 == null) {
/* 28:45 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/generate/tostring/inspection/GenerateToStringQuickFix", "getName" }));
/* 29:   */     }
/* 30:45 */     return tmp2_0;
/* 31:   */   }
/* 32:   */   
/* 33:   */   @NotNull
/* 34:   */   public String getFamilyName()
/* 35:   */   {
/* 36:51 */     String tmp2_0 = "Generate";
/* 37:51 */     if (tmp2_0 == null) {
/* 38:51 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/generate/tostring/inspection/GenerateToStringQuickFix", "getFamilyName" }));
/* 39:   */     }
/* 40:51 */     return tmp2_0;
/* 41:   */   }
/* 42:   */   
/* 43:   */   public void applyFix(@NotNull Project paramProject, @NotNull ProblemDescriptor paramProblemDescriptor)
/* 44:   */   {
/* 45:56 */     if (paramProject == null) {
/* 46:56 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/generate/tostring/inspection/GenerateToStringQuickFix", "applyFix" }));
/* 47:   */     }
/* 48:56 */     if (paramProblemDescriptor == null) {
/* 49:56 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/generate/tostring/inspection/GenerateToStringQuickFix", "applyFix" }));
/* 50:   */     }
/* 51:56 */     PsiClass localPsiClass = (PsiClass)PsiTreeUtil.getParentOfType(paramProblemDescriptor.getPsiElement(), PsiClass.class);
/* 52:57 */     if (localPsiClass == null) {
/* 53:58 */       return;
/* 54:   */     }
/* 55:60 */     this.a.executeActionQuickFix(paramProject, localPsiClass);
/* 56:   */   }
/* 57:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.generate.tostring.inspection.GenerateToStringQuickFix

 * JD-Core Version:    0.7.0.1

 */